package com.iteaj.iot.builder;

import com.iteaj.iot.AbstractProtocolTimeoutManager;
import com.iteaj.iot.FrameworkComponent;
import com.iteaj.iot.business.ProtocolHandleFactory;
import com.iteaj.iot.event.StatusEventListener;

public abstract class AbstractBuilder<C extends FrameworkComponent, L extends StatusEventListener> implements Builder<C, L>{

    private StatusEventListener listener;
    private ProtocolHandleFactory handleFactory;
    private AbstractProtocolTimeoutManager timeoutManager;

    protected StatusEventListener getListener() {
        return listener;
    }

    protected ProtocolHandleFactory getHandleFactory() {
        return this.handleFactory;
    }

    protected AbstractProtocolTimeoutManager getTimeoutManager() {
        return this.timeoutManager;
    }

    protected Builder setListener(StatusEventListener listener) {
        this.listener = listener; return this;
    }

    protected Builder setHandleFactory(ProtocolHandleFactory handleFactory) {
        this.handleFactory = handleFactory; return this;
    }

    protected Builder setTimeoutManager(AbstractProtocolTimeoutManager timeoutManager) {
        this.timeoutManager = timeoutManager; return this;
    }
}
